import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/Login'
import regist from '@/components/Regist'
import vipCenter from '@/components/mine/VipCenter'
import mine from '@/components/mine/Mine'
import Select from '@/components/select'
import aboutUs from '@/components/aboutUs'
// import mainindex from '@/components/mainindex'
import MessageCenter from '@/components/mine/MessageCenter'
import MessageDetail from '@/components/mine/MessageDetail'
import SecurityConfig from '@/components/mine/SecurityConfig'
import ConfirmPhone from '@/components/mine/ConfirmPhone'
import ModifyPassword from '@/components/mine/ModifyPassword'
import ModifyPhone from '@/components/mine/ModifyPhone'
import PayCheckModify from '@/components/mine/PayCheckModify'
import PayCheckSet from '@/components/mine/PayCheckSet'
import VerifyCertification from '@/components/mine/VerifyCertification'
import BountyCenter from '@/components/bountyCenter/BountyCenter'
import AccountManage from '@/components/bountyCenter/AccountManage'
import PostedTask from '@/components/bountyCenter/PostedTask'
import ReceivedResume from '@/components/bountyCenter/ReceivedResume'
import RechargeRecords from '@/components/bountyCenter/RechargeRecords'
import Charge from '@/components/bountyCenter/Charge'
import PublishingTask from '@/components/bountyCenter/PublishingTask'
import CheckTask from '@/components/bountyCenter/CheckTask'
import ReceivedResumeDetail from '@/components/bountyCenter/ReceivedResumeDetail'
import Recruiting from '@/components/Recruiting'
import Contact from '@/components/ContactUs'
import TermCondition from '@/components/TermCondition'
Vue.use(Router)

export default new Router({
  routes: [
    // {
    //   path: '/',
    //   name: 'mainindex',
    //   component: mainindex
    // },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      component: aboutUs
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/termcondition',
      name: 'termcondition',
      component: TermCondition
    },
    {
      path: '/contactus',
      name: 'contactus',
      component: Contact
    },
    {
      path: '/recruiting',
      name: 'recruiting',
      component: Recruiting
    },
    {
      path: '/regist',
      name: 'regist',
      component: regist
    },
    {
      path: '/select',
      name: 'select',
      component: Select
    },
    {
      path: '/vipcenter',
      name: 'vipcenter',
      redirect: '/vipcenter/mine',
      component: vipCenter,
      children: [
        {
          path: 'mine',
          name: 'mine',
          component: mine,
          children: [
            {
              path: '',
              name: 'message',
              components: {
                message: MessageCenter,
                security: SecurityConfig
              }
            },
            {
              path: 'detail',
              name: 'detail',
              components: {
                message: MessageDetail,
                security: SecurityConfig
              }
            },
            {
              path: 'confirmphone',
              name: 'confirmphone',
              components: {
                message: MessageDetail,
                security: ConfirmPhone
              }
            },
            {
              path: 'modifyphone',
              name: 'modifyphone',
              components: {
                message: MessageDetail,
                security: ModifyPhone
              }
            },
            {
              path: 'verifycertification',
              name: 'verifycertification',
              components: {
                message: MessageDetail,
                security: VerifyCertification
              }
            },
            {
              path: 'verifycertification',
              name: 'verifycertification',
              components: {
                message: MessageDetail,
                security: VerifyCertification
              }
            },
            {
              path: 'modifypassword',
              name: 'modifypassword',
              components: {
                message: MessageDetail,
                security: ModifyPassword
              }
            },
            {
              path: 'paycheckset',
              name: 'paycheckset',
              components: {
                message: MessageDetail,
                security: PayCheckSet
              }
            },
            {
              path: 'paycheckmodify',
              name: 'paycheckmodify',
              components: {
                message: MessageDetail,
                security: PayCheckModify
              }
            }
          ]
        },
        {
          path: 'bountycenter',
          name: 'bountycenter',
          component: BountyCenter,
          children: [
            {
              path: '',
              name: 'message',
              components: {
                account: AccountManage,
                posttask: PostedTask,
                receivedresume: ReceivedResume
              }
            },
            {
              path: 'chargerecords',
              name: 'chargerecords',
              components: {
                account: RechargeRecords,
                posttask: PostedTask,
                receivedresume: ReceivedResume
              }
            },
            {
              path: 'charge',
              name: 'charge',
              components: {
                account: Charge,
                posttask: PostedTask,
                receivedresume: ReceivedResume
              }
            },
            {
              path: 'publishingTask',
              name: 'publishingTask',
              components: {
                account: AccountManage,
                posttask: PublishingTask,
                receivedresume: ReceivedResume
              }
            },
            {
              path: 'checktask',
              name: 'checktask',
              components: {
                account: AccountManage,
                posttask: CheckTask,
                receivedresume: ReceivedResume
              }
            },
            {
              path: 'resumedetail',
              name: 'resumedetail',
              components: {
                account: AccountManage,
                posttask: PostedTask,
                receivedresume: ReceivedResumeDetail
              }
            }
          ]
        }
      ]
    }
  ]
})
